package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.ChatterContributionDaoImpl;
import com.asset.salesforce.domain.ChatterContribution;
import com.asset.salesforce.domain.Employee;

@Service
@Transactional(readOnly=true)
public class ChatterContributionService {

	@Autowired
	ChatterContributionDaoImpl chatterContributionDao;
	
	@Transactional(readOnly=false)
	public void addChatter(ChatterContribution chatter) {
		chatterContributionDao.addChatter(chatter);
	}
	
	@Transactional(readOnly=false)
	public void editChater(ChatterContribution chatter) {
		chatterContributionDao.editChatter(chatter);
	}
	
	@Transactional(readOnly=false)
	public void deleteChater(ChatterContribution chatter) {
		chatterContributionDao.deleteChatter(chatter);
	}
	
	@Transactional(readOnly=true)
	public List<ChatterContribution> getAllChatters(){
		return	chatterContributionDao.getAllChatters();
	}
	
	@Transactional(readOnly=true)
	public ChatterContribution getChatterById(Integer id){
		return	chatterContributionDao.getChatterById(id);
	}
	
	@Transactional(readOnly=true)
	public ChatterContribution getChatterByEmployee(Integer empId){
		return	chatterContributionDao.getChatterByEmployee(empId);
	}
}
